package com.sbj.dto.res;

import cn.zhxu.bs.bean.DbField;
import cn.zhxu.bs.bean.SearchBean;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.sbj.dto.jackson.CustomDecimalSerialize;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author summer
 * @version 1.0
 * @date 2024/8/11 22:05
 */
@Data
@SearchBean(tables = " expend i LEFT JOIN member m ON i.member_id=m.id ",autoMapTo = "i",orderBy = "i.createTime DESC")

public class ExpendRes implements Serializable {

    @DbField("i.id")
    private Integer id;

    @DbField("i.price")
    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal price;

    @DbField("i.createTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime createTime;

    @DbField("i.member_id")
    private Integer memberId;

    @DbField("i.name")
    private String name;

    @DbField("i.serial_num")
    private String serialNum;

    @DbField("m.nickName")
    private String nickName;

    @DbField("i.type")
    private Integer type;
}
